<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML>
<html style='height:100%;'>
<head>
<base href="<%=basePath%>">

<title>车辆管理</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link rel="stylesheet" href="css/vivo.css">
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
<link rel="stylesheet" href="js/bootstrap2/css/bootstrap-table.css">
<link rel="stylesheet" href="css/common.css">
<link href="js/select2/select2.min.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css"
	href="static/p_house/house_index.css" />
<link rel="stylesheet" type="text/css"
	href="js/webuploader-0.1.5/webuploader.css" />

<script src="js/jquery-1.11.1.js"></script>
<script src="js/bootstrap2/js/bootstrap.min.js"></script>
<script src="js/bootstrap2/js/bootstrap-table.js"></script>
<script src="js/bootstrap2/js/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript" src="js/layui-v2.1.5/layui/layui.all.js"></script>
<script type="text/javascript"
	src="<%=basePath%>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="js/webuploader-0.1.5/webuploader.js"></script>
<script type="text/javascript" src="js/sharefunction.js"></script>
<script src="js/select2/select2.min.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<style>
th {
	color: white;
	background-color: #F08080
}

.table-striped tbody>tr:nth-child(odd)>td {
	background-color: #EDEDED;
}

.table th, .table td {
	text-align: center;
	vertical-align: middle !important;
}

.bootstrap-table {
	width: 100%
}

.pagination>.active>a {
	border-color: #ddd;
}
</style>
</head>
<script type="text/javascript">
	/* function openAddCar() {
		$("#div_car").show();
		$("iframe[id='toAddCusCar']").attr("src", "roomInfo/toAddCusCar");
	} */
</script>
<body style='height:100%'>
	<div style="padding:0 10px">
		<!-- <a class="btn btn-danger addbtn" onClick='openAddCar()'>新增</a> -->
		<!-- 列表start -->
		<!-- <div style="padding-top:5px">
			车辆列表
			<table id="table"></table>
		</div> -->
		<!-- 列表end -->
		<!-- 表单start -->
		<div id="div_car" style="margin-top: 15px;height:100%">
			<!-- <iframe id="toAddCusCar" name="toAddCusCar" width="100%"
				style="height:100%;" frameborder="0"></iframe> -->
			<jsp:include page="carManage-add.jsp"></jsp:include>
		</div>
		<!-- 表单end -->
		<!-- 隐藏域 -->
		<div style="display: none">
			<input name="carId" id="carId">
		</div>
		<div style="padding-top:5px" class="changeTable">
			<!-- 车辆更改字段列表 -->
			<table id="carManageChageTable" style="table-layout:fixed"></table>
		</div>
	</div>
	<script type="text/javascript">
		$(function() {
			fkcustomerId = parent.$("#customerId").val();
			fkroomId = parent.$("#roomId").val();
			//初始化表格,动态从服务器加载数据  
			 $("#carManageChageTable").bootstrapTable({
				method : "post", //使用get请求到服务器获取数据  
				url : "roomInfo/getCarChangeList", //获取数据的Servlet地址  
				striped : true, //表格显示条纹  
				pagination : true, //启动分页  
				pageSize : 2, //每页显示的记录数  
				pageNumber : 1, //当前第几页  
				pageList : [ 5, 10, 15, 20, 25 ], //记录数可选列表  
				sidePagination : "server", //表示服务端请求  
				contentType : 'application/x-www-form-urlencoded',
				//设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder  
				//设置为limit可以获取limit, offset, search, sort, order  
				queryParamsType : "undefined",
				queryParams : function queryParams(params) { //设置查询参数  
					var param = {
						pageNumber : params.pageNumber,
						pageSize : params.pageSize,
						fkcustomerId : fkcustomerId,
						fkroomId : fkroomId
					};
					return param;
				},
				columns : [ {
					field : 'createtime',
					title : '修改时间',
					width : '15%',
					formatter:carDataFormat
				}, {
					field : 'fieldname',
					title : '修改字段',
					width : '7%'
				}, {
					field : 'changebefore',
					title : '修改前数据',
					width : '25%',
					formatter:showText	
				}, {
					field : 'changeafter',
					title : '修改后数据',
					width : '25%',
					formatter:showText	
				}, {
					field : 'adduser',
					title : '修改人',
					width : '7%',
				}, {
					field : 'remarks',
					title : '变更说明',
					width : '21%',
					formatter:showText	
				} ]
			});
			
		});
		//日期格式化
		function carDataFormat(value, row, index) {
			return new Date(row.createtime).format("yyyy-MM-dd hh:mm:ss");
		}
	
	</script>
</body>
</html>
